﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Cqrs.StateMachineDesigner
{
    public class DomainConverter : System.Windows.Data.IMultiValueConverter
    {
        public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            return string.Format("{0}{1}{2}",
                values[0],
                values[0].ToString().Length == 0 ? "" : ".",
                values[1]);
        }

        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture)
        {
            string[] splitValues = ((string)value).Split('.');
            return splitValues;
        }
    }
}
